<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="gq143896">pg_cursors</title>
  <body>
    <p>The <codeph>pg_cursors</codeph> view lists the currently available cursors.
      Cursors can be defined in one of the following ways:</p>
      <ul>
        <li>via the DECLARE SQL statement</li>
        <li>via the Bind message in the frontend/backend protocol</li>
        <li>via the Server Programming Interface (SPI) <note>Greenplum Database does not
          support the definition, or access of, parallel retrieve cursors via SPI.</note></li>
      </ul>
    <p>Cursors exist only for the duration of the transaction that defines them, unless
      they have been declared <codeph>WITH HOLD</codeph>. Non-holdable cursors are only
      present in the view until the end of their creating transaction.
      <note>Greenplum Database does not support holdable parallel retrieve cursors.</note></p>
    <table id="gq143898">
      <title>pg_cursors</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="121pt"/>
        <colspec colnum="2" colname="col2" colwidth="60pt"/>
        <colspec colnum="3" colname="col3" colwidth="60pt"/>
        <colspec colnum="4" colname="col4" colwidth="247pt"/>
        <thead>
          <row>
            <entry colname="col1">name</entry>
            <entry colname="col2">type</entry>
            <entry colname="col2">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1"><codeph>name</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the cursor.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>statement</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The verbatim query string submitted to declare this
              cursor.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>is_holdable</codeph></entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3"/>
            <entry colname="col4"><codeph>true</codeph> if the cursor is holdable (that is,
              it can be accessed after the transaction that declared the cursor has
              committed); <codeph>false</codeph> otherwise.
              <note>Greenplum Database does not support holdable parallel retrieve cursors,
              this value is always <codeph>false</codeph> for such cursors.</note></entry>
          </row>
          <row>
            <entry colname="col1"><codeph>is_binary</codeph></entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3"/>
            <entry colname="col4"><codeph>true</codeph> if the cursor was declared
              <codeph>BINARY</codeph>; <codeph>false</codeph> otherwise.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>is_scrollable</codeph></entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3"/>
            <entry colname="col4"><codeph>true</codeph> if the cursor is scrollable
              (that is, it allows rows to be retrieved in a nonsequential manner);
              <codeph>false</codeph> otherwise. <note>Greenplum Database does not support
              scrollable cursors, this value is always <codeph>false</codeph>.</note></entry>
          </row>
          <row>
            <entry colname="col1"><codeph>creation_time</codeph></entry>
            <entry colname="col2">timestamptz</entry>
            <entry colname="col3"/>
            <entry colname="col4">The time at which the cursor was declared.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
